#
# @lc app=leetcode.cn id=70 lang=python
#
# [70] 爬楼梯
#

# @lc code=start
class Solution(object):
    def climbStairs(self, n):
        """
        :type n: int
        :rtype: int
        """
        if n == 1:
            return 1
        if n == 2:
            return 2
        dp = [0]*2
        dp[0] = 1
        dp[1] = 2
        for i in range(3, n+1):
            temp = dp[0]+dp[1]
            dp[0] = dp[1]
            dp[1] = temp
        return dp[1]
        
# @lc code=end

